import request from '@/utils/request';

const handlerName = 'AgentServer';
export async function query(params) {
  return request(`/api/AgentServer/GetAgentServerConfigs`, {
    method: 'POST',
    data: params,
  });
}
export async function addOrUpdate(params) {
  return request(`/api/AgentServer/AddOrUpdateAgentConfig`, {
      method: 'POST',
      data: { ...params },
  });
}
export async function update(params) {
  return request(`/api/${handlerName}/Put`, {
    method: 'PUT',
    data: { ...params },
  });
}




export async function get(params) {
  return request(`/api/${handlerName}/GetDetail`, {
    method: 'GET',
    params: { ...params },
  });
}

export async function getHealthy(params) {
  return request(`/api/AgentServer/GetHealthy`, {
    method: 'GET',
    params: { ...params },
  });
}
export async function getAgentRootPath(params) {
  return request(`/api/AgentServer/GetAgentRootPath`, {
    method: 'GET',
    params: { ...params },
  });
}

export async function getDirectory(params) {
  return request(`/api/AgentServer/GetDirectory`, {
    method: 'GET',
    params: { ...params },
  });
}

// 获取文本内容
export async function getFileText(params) {
  return request(`/api/AgentServer/GetFileText`, {
    method: 'GET',
    params: { ...params },
  });
}

export async function agentSaveFileText(params) {
  return request(`/api/AgentServer/AgentSaveFileText`, {
    method: 'POST',
    data: { ...params },
  });
}

